<div id="shell">

</div>
<div class="shellform">

<?php $form=$this->beginWidget('CActiveForm'); ?>

		<?php echo $form->error($model,'comand'); ?>
		<b>admin@eduow:~$&nbsp;</b>
		<?php echo $form->textField($model,'comand',array('size'=>80,'maxlength'=>128)); ?>

<?php $this->endWidget(); ?>

</div><!-- form -->

<script type="text/javascript">
document.getElementById('ShellForm_comand').focus();

$('#ShellForm_comand').keypress(function(event) {
  if (event.keyCode == '13') {
     event.preventDefault();
 if(document.getElementById('ShellForm_comand').value!='cls'){
      jQuery.ajax({
'type':'POST',
'dataType' : 'html',
'url': '/admin/dispatch',
'cache':false,
'data':jQuery(this).parents("form").serialize(),
'success':function(html){
jQuery("#shell").append(html)}
});
}else{
$("#shell").text('');
}
   document.getElementById('ShellForm_comand').value='';
   var objDiv = document.getElementById('shell');
   objDiv.scrollTop = objDiv.scrollHeight;

  }
});
</script>
